/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sistemPembayaranSPP;

import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author w7
 */
public class KelolaTagihanTableModel extends AbstractTableModel {

    private List<TagihanSiswa> k = new ArrayList<TagihanSiswa>();

    public KelolaTagihanTableModel(List<TagihanSiswa> k) {
        this.k = k;
    }

    public int getRowCount() {
        return k.size();
    }

    public int getColumnCount() {
        return 5;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        TagihanSiswa kat = k.get(rowIndex);
        switch (columnIndex) {
            case 0:
                return kat.getNIS();
            case 1:
                return kat.getNama_kelas();
            case 2:
                return kat.getNama();
            case 3:
                return kat.getTahunAjaran();
            case 4:
                return kat.getBiayaBulan();
            default:
                return "";
        }
    }

    @Override
    public String getColumnName(int column) {
        switch (column) {
            case 0:
                return "NIS";
            case 1:
                return "NAMA KELAS";
            case 2:
                return "NAMA SISWA";
            case 3:
                return "TAHUN AJARAN";
            case 4:
                return "BIAYA BULAN";
            default:
                return "";
        }
    }
}
